<template>
	<div class="sell">
		<h2>书籍出售</h2>
		<div class="sell__detail" v-loading="loading">
			<s-person-list :data="item" v-for="(item, index) in sellBooks" :key="index"></s-person-list>	
		</div>
	</div>
</template>

<script>
	import { fetchSellBooks } from "../../../../api/api.js"
	export default {
		created() {
			this.getSellBooks();
		},
		data() {
			return {
				sellBooks: null,
				loading: true
			}
		},
		methods: {
			getSellBooks() {
				this.loading = true;
				fetchSellBooks().then( res => {
					this.loading = false;
					this.sellBooks = res.data.result;
				} ).catch( err => {
					alert(err);
					console.log(err);
				});
			}
		}
	}
</script>

<style scoped lang="scss">
	.sell {
		@include index_title;
	}
	.sell__detail {
		/*默认有一个高度，防止没有数据的时候造成塌陷*/
		min-height: rem(200);
	}
</style>